Skip to content

feat: KV cache based on predis#61690

Merged
susnux merged 3 commits into
masterfrom
feat/valkey
Jul 13, 2026
Merged

feat: KV cache based on predis#61690
susnux merged 3 commits into
masterfrom
feat/valkey

Conversation

@susnux

@susnux susnux commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Implemented a new memcache implementation based on predis which does not require any PHP modules to be installed but instead relies on the pure PHP library predis.

This adds support for recent releases of Redis and Valkey (e.g. v8 or v9).
Some features are still missing (numbered databases in clusters) but this will be added soon by predis.

AI was used for documentation texts of config example and test generation.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@susnux susnux added this to the Nextcloud 35 milestone Jul 1, 2026
@susnux susnux added the 2. developing Work in progress label Jul 1, 2026
@susnux susnux added enhancement feature: caching Related to our caching system: scssCacher, jsCombiner... labels Jul 1, 2026
Comment thread lib/private/RedisFactory.php Outdated
Comment thread config/config.sample.php Outdated
@susnux susnux marked this pull request as ready for review July 1, 2026 15:25
@susnux susnux requested a review from a team as a code owner July 1, 2026 15:25
@susnux susnux requested review from Altahrim, ArtificialOwl, icewind1991 and leftybournes and removed request for a team July 1, 2026 15:25
@susnux susnux added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 1, 2026
Comment thread lib/private/Memcache/KeyValueCache.php Outdated
Comment thread lib/private/Memcache/KeyValueCache.php
Comment thread lib/private/Memcache/KeyValueCache.php
Comment thread lib/private/Memcache/KeyValueCache.php Outdated
Comment thread lib/private/Memcache/KeyValueCache.php Outdated
* so fall back to the default and cap it to the maximum.
*/
private function normalizeTtl(int $ttl): int {
if ($ttl === 0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($ttl === 0) {
if ($ttl <= 0) {

Negative TTL surely isn't good as well, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Negative TTL is currently relied upon so this will break locking. Was working on this recently. See #62062.

Comment thread lib/private/Memcache/KeyValueCacheFactory.php Outdated
Comment thread lib/private/Memcache/KeyValueCacheFactory.php
Comment thread lib/private/Memcache/Redis.php Outdated
Comment thread lib/private/RedisFactory.php Outdated
Comment thread lib/private/Memcache/Redis.php Outdated
Comment thread lib/private/Memcache/KeyValueCache.php Outdated
Comment thread lib/private/Memcache/KeyValueCache.php Outdated
@susnux susnux added the pending documentation This pull request needs an associated documentation update label Jul 13, 2026
Assisted-by: ClaudeCode:claude-opus-4-8
Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux

susnux commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

(rebased to include 3rdparty changes)

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux dismissed provokateurin’s stale review July 13, 2026 16:53

issues resolved

@susnux susnux merged commit 9aed6ce into master Jul 13, 2026
234 of 245 checks passed
@susnux susnux deleted the feat/valkey branch July 13, 2026 16:53
@susnux

susnux commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Documentation in nextcloud/documentation#15308

@susnux susnux removed the pending documentation This pull request needs an associated documentation update label Jul 13, 2026
@susnux

susnux commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

/backport to stable34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted enhancement feature: caching Related to our caching system: scssCacher, jsCombiner...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants